<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>组合继承模式</title>
</head>
<body>
<script>
function Parent(id) {
	this.id = id;
}
Parent.prototype = {
	getId: function() {
		return this.id;
	},
	setId: function(id) {
		this.id = id;
	},
};
function Child(id, name) {
	// 重点1
	Parent.call(this, id);
	this.name = name;
}
// 重点2
Child.prototype = Object.create(Parent.prototype);
Child.prototype.constructor = Child;


Child.prototype.getName = function() {
	return this.name;
};
Child.prototype.setName = function(name) {
	this.name = name;
};
const c1 = new Child(11, 'mm');
console.log(c1);
</script>
</body>
</html>